.. _migration_data: Working with Migration Data (BIOIMMIG) ***************************************** .. |migback ppfad| raw:: html "migback" .. |migback ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/migback}{\textbf{"migback"}} .. |germborn ppfad| raw:: html "germborn" .. |germborn ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/germborn}{\textbf{"germborn"}} .. |corigin ppfad| raw:: html "corigin" .. |corigin ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/corigin}{\textbf{"corigin"}} .. |immiyear ppfad| raw:: html "immiyear" .. |immiyear ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/immiyear}{\textbf{"immiyear"}} With its migration and refugee samples, SOEP provides a wide range of information on people with a history of migration or forced migration. In the BIOIMMIG dataset, you will find relevant information on the history of migration or forced migration, including refugees' and migrants' motives for leaving their country of origin, their living conditions upon arrival in Germany, as well as information in edited form on any relatives in the country of origin and the desire to return to the country of origin. For more information about this dataset and a list of the variables it contains, see: `BIOIMMIG Documentation `_. In the following, we will use this record and other information from the SOEP to create a status variable that you can use to distinguish whether or not people with a migration background also have a background of forced migration, that is, whether migrants are also refugees. **Create an exercise path with four subfolders:** .. figure:: png/uebungspfade.png :align: center **Example:** - H:/material/exercises/do - H:/material/exercises/output - H:/material/exercises/temp - H:/material/exercises/log These are used to store commands, log files, datasets, and temporary datasets. Open an empty do-file and define your paths with globals: .. literalinclude:: docs/Arbeit_ppfad.do :linenos: :lines: 8-16 The global "AVZ" defines the main path. The main paths are subdivided using the globals "MY_IN_PATH", "MY_DO_FILES", "MY_LOG_OUT", "MY_OUT_DATA", "MY_OUT_TEMP". The global "MY_IN_PATH" contains the path to the data you ordered. **Task 1: Preperation of the Data** Use the :ref:`Tracking` PPATHL as a master file and merge the appropriate migration dataset. Open the record or browse the documentation and search for a variable describing the immigration status. The biimgrp variable from the BIOIMMIG data set is the appropriate variable. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 6-25 **a) Which variable contains information about the status of each person when they immigrated to Germany?** Familiarize yourself with your variable and check the coding and case numbers. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 32 Familiarize yourself with your variable and check the coding and case numbers. .. figure:: png/mig_1.png :align: center **b) On the basis of this variable, generate the variable "escape", which only distinguishes among three groups:** - 0 = Cases where no information is available - 1 = All persons without escape background - 2 = Asylum seekers / refugees After you have familiarized yourself with the variable, recode it to fit your project. Then check the case numbers of your generated variable with the source variable. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 57-58 .. figure:: png/mig_2.png :align: center **c) It may be that initially there is no information on the immigration status but this will change one year later. Limit the dataset to the last observation available on the respective person, since this gives you the most comprehensive information.** .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 86-87 **f) Save the generated data temporarily on your personal drive.** .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 101-104 **Task 2: Add basic variables from PPATH and weights** .. Attention:: Please note that since version 34 (v34), PPFAD can be found in the subdirectory “Raw” of the data distribution file. The following exercises are done with version 33.1 (v33.1), where the tracking file was named PPFAD. **a) Load the following information from PPATH:** .. |persnr ppfad| raw:: html "persnr" .. |persnr ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/persnr}{\textbf{"persnr"}} .. |hhnr ppfad| raw:: html "hhnr" .. |hhnr ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/hhnr}{\textbf{"hhnr"}} .. |bghhnr ppfad| raw:: html "bghhnr" .. |bghhnr ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/bghhnr}{\textbf{"bghhnr"}} .. |bgnetto ppfad| raw:: html "bgnetto" .. |bgnetto ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/bgnetto}{\textbf{"bgnetto"}} .. |sex ppfad| raw:: html "sex" .. |sex ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/sex}{\textbf{"sex"}} .. |gebjahr ppfad| raw:: html "gebjahr" .. |gebjahr ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/gebjahr}{\textbf{"gebjahr"}} .. |psample ppfad| raw:: html "psample" .. |psample ppfad2| raw:: latex \href{https://paneldata.org/soep-core/data/ppfad/psample}{\textbf{"psample"}} - Permanent Indivdiual Identifier |persnr ppfad| |persnr ppfad2| - Household Identifier |hhnr ppfad| |hhnr ppfad2| and the current household number |bghhnr ppfad| |bghhnr ppfad2| - The net variable with information about the interview type |bgnetto ppfad| |bgnetto ppfad2| - The gender of the person |sex ppfad| |sex ppfad2| - The year of birth |gebjahr ppfad| |gebjahr ppfad2| - Variables on the migration background |migback ppfad| |migback ppfad2|, |germborn ppfad| |germborn ppfad2|, |corigin ppfad| |corigin ppfad2|, |immiyear ppfad| |immiyear ppfad2| - Information about the survey status: |psample ppfad| |psample ppfad2| If you want to familiarize yourself with the PPATH dataset, see the section :ref:`working_ppfad`. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 108-119 **b) Merge the previously generated data using the individual identifier.** If you don't understand how to create your own cross-sectional dataset, see the chapter :ref:`cross_data`. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 121-125 **c) Add the corresponding individual extrapolation factors to the data.** .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 128-131 **d) Only keep respondents who completed a youth or individual questionnaire in 2016.** For example, to exclude children who have not provided immigration status information, use the net code from PPATH. Only keep individuals who completed an individual or youth interview. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 133-139 .. figure:: png/mig_3.png :align: center **Task 3: Generate a status variable with the following categories:**. - No migration background - Migrant, 2nd generation - Migrant, no information - Migrant, not refugee - Migrant, refugee To generate this status variable, check the contents of the existing migration variables from PPATH (migback germborn). .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 143-147 .. figure:: png/mig_4.png :align: center .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 149 .. figure:: png/mig_5.png :align: center Use the migration variables from PPATH (migback, germborn) and link this information with your previously generated refugee variable to build the described status variable from Task 3. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 151-159 **Task 4: Content analysis:** **a) How many refugees (foreign-born with refugee/asylum status) are now in your file?** Look at your status variable previously generated in task 3 to answer the question. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 161-167 .. figure:: png/mig_6.png :align: center All 4,514 respondents who received the value 5 for the generated status variable have a direct migration background (migback==2), were not born in Germany (germborn==2), and fled their country of origin (flight==2 and biimgrp==5). **b) How many are there if you take the individual extrapolation factors into account? Interpret the results.** Look at the status variable generated in task 3 to answer the question. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 186-190 .. figure:: png/mig_7.png :align: center After weighting, there are approximately 675 refugees in the dataset. The weighting thus corrected the number of refugees downwards. **c) How many persons are represented in the sample, taking the extrapolation factors into account?** To use frequency weights in STATA, integer weights are required. Create an integer frequency weight from the weighting factor provided so that you can make representative statements. Then take a look at the new results. .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 209-214 .. figure:: png/mig_8.png :align: center Around 1,600,000 people are represented. **d) What is the proportion of people over 40 years of age among the refugees?** Since the data in this exercise come from the wave "bg", we are currently in the survey year 2016; if you need a description of the wave designations, please refer to the chapter :ref:`Label`. To generate a suitable age variable, you can use the year of birth (year of birth). If we look at the survey year 2016, all persons born in 1976 or earlier were over 40 years old. Generate a suitable age variable and look at the proportion of refugees over 40 years of age in weighted form: .. literalinclude:: docs/SOEPcampus_Migration_Solution.do :linenos: :lines: 232-239 .. figure:: png/mig_9.png :align: center The proportion of refugees over 40 years of age is about 47%. Last change: |today|